1. Field of the Invention
The invention relates generally to processor-based systems and more particularly to the loading time of an operating system (OS).
2. Description of Related Art
To execute a program, a processor in a computer system has to access the executable code of the program from memory. When the computer is first powered up, the processor usually executes the Basic Input and Output System (BIOS) program. The BIOS contains the executable code for a boot-up program. It is essentially built-in software containing a set of instructions that control system devices and test memory. Because it is typically stored in a Read-Only Memory (ROM) chip on the motherboard, it is sometimes call a ROM BIOS.
In a typical power up sequence, the processor is activated upon power up and sends a message to activate the BIOS. When executed, the BIOS runs a series of tests, called the POST for Power On Self Test, to make sure the system devices are working correctly. In general, the BIOS initializes system hardware and chipset registers, initializes power management, tests RAM (Random Access Memory), enables the keyboard, tests serial and parallel ports, initializes floppy disk drives and hard disk drive controllers, and displays system summary information. During POST, the BIOS compares the system configuration data obtained from POST with the system information stored on a CMOS (Complementary Metal-Oxide Semiconductor) memory chip located on the motherboard. This CMOS chip, which is updated whenever new system components are added, contains the latest information about system components.
After the POST is complete, the BIOS looks for the boot program responsible for loading the operating system. Usually, the BIOS looks on the floppy disk drive A followed by hard drive C. After being loaded into memory, the boot program then loads the system configuration information, typically contained in the registry in the operating system (OS) environment, and device drivers. Finally, the operating system is loaded, and, default programs in a start up directory or folder are executed.
The BIOS also helps operating systems and application programs manage the hardware by means of a set of routines called BIOS Run-Time Services. Application programs as well as the operating system can call these services to perform hardware-related functions.
The loading time of the operating system and/or programs into the system or main memory is variable and depends on a number of factors. One factor is the processor""s speed. Another factor is the type of mass storage that stores the OS or the program to be loaded.
Accordingly, there is a need in the technology to provide a simple and efficient method to determine the loading time of a program or an operating system.
The present invention is a method and apparatus to determine loading time of an operating system in a computer system. A basic input and output system (BIOS) retrieves a first time value from a real-time clock. The BIOS loads the OS into memory of the computer system. The OS has a device driver. The device driver retrieves a second time value from the real-time clock. A time difference is computed based on the first and second time value to obtain the loading time of the OS.